<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>aio_suspend</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_001_149">&nbsp;</a>NAME</h4><blockquote>
aio_suspend - wait for an asynchronous I/O request
(<b>REALTIME</b>)
</blockquote><h4><a name = "tag_000_001_150">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="aio.h.html">aio.h</a>&gt;

int aio_suspend(const struct aiocb * const <i>list</i>[], int <i>nent</i>,
    const struct timespec *<i>timeout</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_001_151">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>aio_suspend()</i>
function suspends the calling thread 
until at least one of the
asynchronous I/O operations referenced by the
<i>list</i>
argument has completed,
until a signal interrupts the function,
or, if
<i>timeout</i>
is not NULL, until the time interval specified by
<i>timeout</i>
has passed.
If any of the
<b>aiocb</b>
structures in the list correspond to completed asynchronous I/O operations
(that is, the error status for the operation is not equal to EINPROGRESS)
at the time of the call,
the function returns without suspending the calling thread
The
<i>list</i>
argument is an array of pointers to asynchronous I/O control blocks.
The
<i>nent</i>
argument indicates the number of elements in the array.
Each
<b>aiocb</b>
structure pointed to will have been used in initiating an asynchronous
I/O request via
<i><a href="aio_read.html">aio_read()</a></i>,
<i><a href="aio_write.html">aio_write()</a></i>,
or
<i><a href="lio_listio.html">lio_listio()</a></i>.
This array may contain NULL pointers, which are ignored.
If this array contains pointers that refer to
<b>aiocb</b>
structures that have not been used in submitting asynchronous I/O,
the effect is undefined.
<p>
If the time interval indicated in the
<b>timespec</b>
structure pointed to by
<i>timeout</i>
passes before any of the I/O operations referenced by
<i>list</i>
are completed, then
<i>aio_suspend()</i>
returns with an error.
</blockquote><h4><a name = "tag_000_001_152">&nbsp;</a>RETURN VALUE</h4><blockquote>
If the
<i>aio_suspend()</i>
function returns after one or more asynchronous I/O operations have completed,
the function returns zero.
Otherwise, the function returns a value of -1 and sets
<i>errno</i>
to indicate the error.
<p>
The application may determine which asynchronous I/O completed
by scanning the associated error and return status using
<i><a href="aio_error.html">aio_error()</a></i>
and
<i><a href="aio_return.html">aio_return()</a></i>,
respectively.
</blockquote><h4><a name = "tag_000_001_153">&nbsp;</a>ERRORS</h4><blockquote>
The 
<i>aio_suspend()</i>
function will fail if:
<dl compact>

<dt>[EAGAIN]<dd>
No asynchronous I/O indicated in the list referenced by
<i>list</i>
completed in the time interval indicated by
<i>timeout</i>.

<dt>[EINTR]<dd>
A signal interrupted the
<i>aio_suspend()</i>
function.
Note that, since each asynchronous I/O operation
may possibly provoke a signal when it completes,
this error return may be caused by the completion of one (or more) of the
very I/O operations being awaited.

<dt>[ENOSYS]<dd>
The
<i>aio_suspend()</i>
function is not supported by this implementation.

</dl>
</blockquote><h4><a name = "tag_000_001_154">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_155">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_156">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_157">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="aio_read.html">aio_read()</a></i>,
<i><a href="aio_write.html">aio_write()</a></i>,
<i><a href="lio_listio.html">lio_listio()</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

